//****************************************************************************************
//  RandoNumbers.java   Java Foundations
//
//  Demonstrates the creation of perudo-random numbers using the
//  Random class.
//****************************************************************************************

import java.util.Random;

public class RandoNumbers
{
  //---------------------------------------------------------
  // Generates random numbers in various ranges.
  //---------------------------------------------------------
    public static void main (String[] args)
    {
      Random generator = new Random();
     
      int Num1;
      float num2;

      Num1 = generator.nextInt();
      System.out.println ("A random integer; " + Num1);

      Num1 = generator.nextInt(10);
      System.out.println ("From 0 to 9; " + Num1);

      Num1 = generator.nextInt(10) + 1;
      System.out.println ("From 1 to 10: " + Num1);

      Num1 = generator.nextInt(15) + 20;
      System.out.println ("From - 10 to 9: " + Num1);

      num2 = generator.nextInt();
      System.out.println ("A random float (beatween 0-1): " + num2);

      num2 = generator.nextFloat() * 3;  //0.0 to 5.999999
      Num1 = (int)num2 - 3;
      System.out.println ("From -3 to 3: " + Num1);
   }
}
